import { vipList, vipOne, vipUpdate } from "../../request/api"
import { successAlert } from "../../utils/alert";
const state = {
    vip: []
}
const mutations = {
    changeVip(state, res) {
        state.vip = res;
    }
}
const actions = {
    vipListActions(context, data) {
        vipList(data).then(res => {
            if (res.code === 200) {
                context.commit("changeVip", res.list)
            }
        })
    },
    vipUpdateActions(context,data){
        vipUpdate(data).then(res=>{
            if(res.code===200){
                successAlert(res.msg);
                console.log(res);
            }
        })
    }
}
const getters = {
    vip(state) {
        return state.vip;
    }
}

export default {
    state,
    mutations,
    actions,
    getters,
    namespaced: true
}